package com.itheima.hotel.controller;

import com.itheima.hotel.pojo.PageResult;
import com.itheima.hotel.pojo.RequestParams;
import com.itheima.hotel.service.IHotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping("/hotel")
public class HotelController {

    @Autowired
    private IHotelService hotelService;


    /*
    * 搜素业务
    * */
    @PostMapping("/list")
    public PageResult search(@RequestBody RequestParams params) throws IOException {
       return hotelService.search(params);
    }



}
